﻿using Abp.Domain.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.Core.Entities
{
    /// <summary>
    /// 交易 退款申请
    /// </summary>
    [Table("Trade_RefundApply")]
    [Serializable]
    public partial class TradeRefundApply : Entity<long>, IApplyState
    {
        /// <summary>
        /// 应用Id
        /// </summary>
        [Required]
        [StringLength(maximumLength: 36)]
        public string AppId { get; set; }

        /// <summary>
        /// 申请单号
        /// </summary>
        [Required]
        [StringLength(maximumLength: 32)]
        public string ApplyNo { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        [Required]
        [StringLength(maximumLength: 32)]
        public string OrderNo { get; set; }

        //交易号
        [Required]
        [StringLength(maximumLength: 64)]
        public string TradeNo { get; set; }

        /// <summary>
        /// 会员编号
        /// </summary>
        [StringLength(maximumLength: 64)]
        public string MemberNo { get; set; }

        /// <summary>
        /// 交易通道Id
        /// </summary>
        [Required]
        public string ChannelId { get; set; }

        //申请金额
        public decimal ApplyMoney { get; set; }

        public string AppIp { get; set; }

        //通知地址(Post)
        [StringLength(maximumLength: 255)]
        public string NotifyUrl { get; set; }

        //扩展参数
        public string ExtraParam { get; set; }

        //原因
        [StringLength(maximumLength: 255)]
        public string Reason { get; set; }

        //退款交易号
        [StringLength(maximumLength: 64)]
        public string RefundTradeNo { get; set; }

        //申请时间
        public DateTime ApplyTime { get; set; }

        /// <summary>
        /// 最后提交时间
        /// </summary>
        public DateTime? LastSubmitTime { get; set; }

        //申请状态
        public int ApplyState { get; set; }

        //申请状态消息
        [Required]
        // [StringLength(maximumLength: 255)]
        public string ApplyStateMessage { get; set; }

    }
}
